﻿<UserControl xmlns:my="clr-namespace:DictationTool.View" 
             xmlns:ViewModel="clr-namespace:DictationTool.ViewModel"  
             x:Class="DictationTool.View.MainWindowView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Border Grid.RowSpan="3" Background="#FF3C8DC5" BorderBrush="#FF3C8DC5" BorderThickness="2" Margin="0" CornerRadius="8">
        <Grid Margin="5">
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="White" Offset="0.5" />
                    <GradientStop Color="WhiteSmoke" Offset="0" />
                    <GradientStop Color="LightGray" Offset="1" />
                </LinearGradientBrush>
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" Background="#FF3C8DC5" x:Name="NewTitle">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Horizontal" Grid.Column="0" VerticalAlignment="Top" Margin="0,3">
                    <Image Source="../Images/title.png" Width="20">
                        <Image.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Open" Margin="0">
                                    <MenuItem Header="Open Media" Command="{Binding Path=OpenMediaCommand, Mode=OneTime}"/>
                                    <MenuItem Header="Open DCT" Command="{Binding Path=OpenCommand, Mode=OneTime}"/>
                                </MenuItem>
                                <Separator  Margin="0"/>
                                <MenuItem Header="Save" Margin="0">
                                    <MenuItem Header="Save to DCT" Command="{Binding Path=SaveFileCommand, Mode=OneTime}"/>
                                    <MenuItem Header="Save to Html" Command="{Binding Path=SaveToHtmlCommand, Mode=OneTime}"/>
                                </MenuItem>
                                <Separator  Margin="0"/>
                                <MenuItem Header="Close" Margin="0" Command="{Binding Path=CloseCommand, Mode=OneTime}"/>
                                <Separator  Margin="0"/>
                                <MenuItem Header="Exit" Margin="0" Command="{Binding Path=ExitCommand, Mode=OneTime}"/>
                            </ContextMenu>
                        </Image.ContextMenu>
                    </Image>
                </StackPanel>
                <TextBlock Grid.Column="1" Text="Dictation Cool" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="16" FontWeight="Bold"/>
                <StackPanel Grid.Column="2" VerticalAlignment="Top" Margin="0,3" Orientation="Horizontal" >
                    <Button Width="20" Height="20" Command="{Binding Path=MinimiceCommand, Mode=OneTime}" ToolTip="Minimize">
                        <Button.Content>
                            <Rectangle Width="11" Height="3" Fill="#FF65BBF7"/>
                        </Button.Content>
                    </Button>
                    <CheckBox Width="20" Height="20" Command="{Binding Path=MaximiceCommand, Mode=OneTime}" Style="{StaticResource Maximize}" />
                    <Button Width="20" Height="20" Command="{Binding Path=ExitCommand, Mode=OneTime}" ToolTip="Close">
                        <Button.Content>
                            <Path Width="11" Height="11"
                                  Stretch="Fill" Fill="#FF65BBF7" 
                                  HorizontalAlignment="Center" 
                                  VerticalAlignment="Center"
                                  Data="F1 M 19.1071,1.31958L 13.4037,7.02301L 7.70346,1.32281C 5.94031,-0.440369 3.08817,-0.440491 1.32666,1.32098C -0.440063,3.08777 -0.441406,5.94135 1.32178,7.70453L 7.02194,13.4047L 1.3219,19.1048C -0.439209,20.8659 -0.44101,23.7274 1.31848,25.4868C 3.08203,27.2504 5.94305,27.2482 7.70419,25.4871L 13.4043,19.787L 19.1086,25.4913C 20.8681,27.2509 23.7287,27.2565 25.4955,25.4897C 27.2569,23.7283 27.2498,20.8691 25.4903,19.1096L 19.786,13.4053L 25.4893,7.7019C 27.2468,5.94452 27.2508,3.08154 25.4873,1.31805C 23.7278,-0.441467 20.8645,-0.437805 19.1071,1.31958 Z "/>
                        </Button.Content>
                    </Button>
                </StackPanel>
            </Grid>
            <Grid Grid.Row="1" Margin="5">
                <my:MediaPlayerView DataContext="{Binding Path=MediaPlayerViewModel}"/>
            </Grid>
            <Grid Grid.Row="2" Margin="5,5,5,0">
                <Grid.Resources>
                    <DataTemplate DataType="{x:Type ViewModel:DictationViewModel}" >
                        <my:DictationView/>
                    </DataTemplate>
                </Grid.Resources>
                <my:WelcomeView Visibility="{Binding Path=DictationViewModel, Converter={StaticResource ObjectToVisible}}"/>
                <ContentControl Content="{Binding Path=DictationViewModel}"/>
            </Grid>
        </Grid>
    </Border>
</UserControl>
